package cn.kstry.demo.config;

import cn.kstry.framework.core.component.bpmn.BpmnProcessParser;
import cn.kstry.framework.core.component.bpmn.builder.SubProcessLink;
import cn.kstry.framework.core.component.dynamic.creator.DynamicSubProcess;

import com.google.common.collect.Lists;
import org.springframework.stereotype.Component;

import java.io.InputStream;
import java.util.List;

@Component
public class DynamicSubProcessRegister implements DynamicSubProcess {

    @Override
    public List<SubProcessLink> getSubProcessLinks() {
        InputStream inputStream = DynamicSubProcessRegister.class.getClassLoader().getResourceAsStream("dynamic/goods.bpmn");
        BpmnProcessParser parser = new BpmnProcessParser("动态获取流程", inputStream);
        return Lists.newArrayList(parser.getAllSubProcessLink().values());
    }
}
